-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add warning message about release version to dnf plugin #3385
Conversation
jirihnidek
commented
Mar 12, 2024
•
edited
Loading
edited
- Card ID: CCT-171
- New feature: when a release is set by subscription-manager, then dnf plugin "subscription-manager" prints warning about this release
- The information about release is read only from cache file to not slow down DNF.
60eab4a
to
aba1178
Compare
Coverage (computed on Fedora latest) •
|
094f183
to
d0d0370
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to work most of the time, there is a bug I found out while testing (explained later).
The first commit factors out code from ReleaseCommand._get_consumer_release()
into a new get_consumer_release()
helper, using it also in the dnf plugin; then the second commit stops using get_consumer_release()
in the dnf plugin, leaving this helper used only by its original user (ReleaseCommand._get_consumer_release()
). Since these changes are not actually needed for the changes in the dnf plugin, then I'd suggest to simplify the changes in this PR:
- squash the first and the second commit together, since it is enough one commit to change the dnf plugin
- drop the changes in
src/subscription_manager/cli_command/release.py
andsrc/subscription_manager/release.py
altogether
I tried to first --set
a release, then --unset
it; the releaseVer
attribute of the consumer is now an empty string:
# cat /var/lib/rhsm/cache/releasever.json ; echo
{"releaseVer": ""}
this results in the following output:
# dnf update
Updating Subscription Management repositories.
This system has release set to and it receives updates only for this release.
Last metadata expiration check: 0:09:54 ago on Wed Mar 27 06:36:24 2024.
[...]
ReleaseCommand.show_current_release()
handles both None
and empty:
subscription-manager/src/subscription_manager/cli_command/release.py
Lines 70 to 71 in 66a176d
release = self._get_consumer_release() | |
if release: |
So most likely the dnf plugin ought to do that too; i.e.
if release_version is not None:
into
if release_version:
Thanks!
d1e7016
to
707f9b4
Compare
* Card ID: CCT-171 * New feature: when a release is set by subscription-manager, then dnf plugin "subscription-manager" prints warning about this release * Information about release is read only from cache file. When there is cache file containing information about current release, then only this information is used for printing warning about release lock. Gathering such information from candlepin would unnecessarily slow down DNF.
707f9b4
to
9979053
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!